﻿@{
    try
    {
        var simSample = (DDBS_Server.Models.Sample)ViewBag.simSample;
        var resSample = (DDBS_Server.Models.Sample)ViewBag.resSample;
        var theme = ViewBag.theme;
        var type = ViewBag.chart;
        
        var basicChart = new Chart(width: 850, height: 400, theme: theme)
            .AddTitle(resSample.ToString())
            .AddSeries(
                chartType: type,
                name: simSample.Name,
                legend: simSample.Name,
                markerStep: 1,
                xValue: simSample.getMs(),
                yValues: simSample.getVs()
                )
            .AddSeries(
                chartType: type,
                name: resSample.Name,
                legend: resSample.Name,
                markerStep: 1,
                xValue: resSample.getMs(),
                yValues: resSample.getVs()
                )
            //.AddSeries(
            //    chartType: type,
            //    name: "test",
            //    legend: "test",
            //    markerStep: 1,
            //    xValue: new[] { 11.1, 11.3, 11.9, 12, 13 },
            //    yValues: new[] { 50, 20, 113, 72, 135 }
            //    )
            .AddLegend(null, simSample.Name)
            .AddLegend(null, resSample.Name)
            .Write();
    }
    catch(Exception e)
    { }
}
